<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simGetConfigForTipPose</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simGetConfigForTipPose" id="simGetConfigForTipPose"></a>simGetConfigForTipPose / sim.getConfigForTipPose </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr><div>DEPRECATED. Use the <a href="../kinematicsPlugin.htm">kinematic plugin</a> functionality instead.</div><br><div>Searches for a manipulator configuration that matches a given end-effector position/orientation in space. Search is randomized. One should call <a href="simGetAlternateConfigs.htm">sim.getAlternateConfigs</a> for each returned configuration, if some revolute joints of the manipulator have a range of more than 360 degrees, in order to generate some equivalent poses but alternate configurations.</div></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simGetConfigForTipPose(simInt ikGroupHandle,simInt jointCnt,const simInt* jointHandles,simFloat thresholdDist,simInt maxTimeInMs,simFloat* retConfig,const simFloat* metric,simInt collisionPairCnt,const simInt* collisionPairs,const simInt* jointOptions,const simFloat* lowLimits,const simFloat* ranges,simVoid* reserved)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>ikGroupHandle</strong>: the handle of an IK group that is in charge of bringing the manipulator's tip onto a target. The IK group can also be marked as <em>explicit handling</em> if needed. See also <a href="simGetIkGroupHandle.htm">simGetIkGroupHandle</a>.</div>
<div><strong>jointCnt</strong>: the number of joint handles provided in the <em>jointHandles</em> array.</div>
<div><strong>jointHandles</strong> (input): an array with <em>jointCnt</em> entries, that specifies the joint handles for the joints we wish to retrieve the values calculated by the IK.</div>
<div><strong>thresholdDist</strong>: a distance indicating when IK should be computed in order to try to bring the tip onto the target: since the search algorithm proceeds by generating random configurations, many of them produce a tip pose that is too far from the target pose to run IK successfully. Choosing a large value will result in slow calculations, choosing a small value might produce a smaller subset of solutions. Distance between two poses is calculated using a <em>metric</em>.</div>
<div><strong>maxTimeInMs</strong>: a maximum time in ms after which the search is aborted.</div>
<div><strong>retConfig</strong> (output): an array with <em>jointCnt</em> entries, that will receive the IK calculated joint values, as specified by the <em>jointHandles</em> array.</div>
<div><strong>metric</strong> (input): an array to 4 values indicating a metric used to compute pose-pose distances: distance=sqrt((dx*metric[0])^2+(dy*metric[1])^2+(dz*metric[2])^2+(angle*metric[3])^2). Can be nullptr for a default metric of {1.0,1.0,1.0,0.1}.</div>
<div><strong>collisionPairCnt</strong>: the number of collision pairs. Can be 0 if collision checking is not required.</div>
<div><strong>collisionPairs</strong>: an array containing 2 <a href="../entities.htm">entity</a> handles for each collision pair. A collision pair is represented by a collider and a collidee, that will be tested against each other. The first pair could be used for robot self-collision testing, and a second pair could be used for robot-environment collision testing. The collider can be an <a href="../objects.htm">object</a> or a <a href="../collections.htm">collection</a> handle. The collidee can be an object or collection handle, or <em>sim_handle_all</em>, in which case the collider will be checked agains all other collidable objects in the scene. Can be nullptr if collision checking is not required.</div>
<div><strong>jointOptions</strong>: a bit-coded value corresponding to each specified joint handle. Bit 0 (i.e. 1) indicates the corresponding joint is dependent of another joint. Can be nullptr.</div>
<div><strong>lowLimits</strong>: an optional array pointing to different low limit values for each specified joint. This can be useful when you wish to explore a sub-set of the joint's intervals. Can be nullptr for the default joint's low limit values. If not nullptr, then <em>ranges</em> should also not be nullptr.</div>
<div><strong>ranges</strong>: an optional array pointing to different range values for each specified joint. This can be useful when you wish to explore a sub-set of the joint's intervals. Can be nullptr for the default joint's range values. If not nullptr, then <em>lowLimits</em> should also not be nullptr.</div>
<div><strong>reserved</strong>: reserved for future extension. Set to nullptr.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 in case of an error, 0 if no result was found, otherwise 1.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>table[] jointPositions=sim.getConfigForTipPose(int ikGroupHandle,table[] jointHandles,float distanceThreshold,int maxTimeInMs,table[4] metric=nil,table[] collisionPairs=nil,table[] jointOptions=nil,table[] lowLimits=nil,table[] ranges=nil)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
